<?php
interface Computer {
    
    public function version(); 
    public function work();
}

class NotebookComputer implements Computer { 
    public function version() {
    
    
        print( '联想120');
        
    }
    
    public function work() { 
        print( '笔记本正在随时携带运行！');
    }

}

class desktopComputer implements Computer{ 
    public function version() {
    print( 'IBM');
        
    }

    public function work() { 
        print( '台式电脑正在工作站运行！');
    }

}

class Person {
    
    public function run($type) { 
        $type->version(); 
        $type->work();
    }
    
}

$person = new Person();

$desktopcomputer = new desktopComputer(); 
$notebookcomputer = new NoteBookComputer(); 
$person->run($notebookcomputer);


/* function __autoload($_className) { require $_className.'.class.php';

} */
/* function spl_autoload_register($_className) { 
    require $_className.'.class.php';

}
 */

$demo = new Person();
